package com.design.pattern.strategy;

/**
 * Created by Administrator on 2016/5/16.
 */
public class TestMain {
    public static void main(String[] args) {
        Context context = new Context();
        System.out.println("----孙权要杀刘备，设置策略----");
        context.setStrategy(new BackDoor());
        context.handle();
        System.out.println("-----刘备乐不思蜀，更换策略----");
        context.setStrategy(new GiveGreenLight());
        context.handle();
        System.out.println("-----刘备逃回蜀国，路遇追兵，更换策略---");
        context.setStrategy(new BlockEnemy());
        context.handle();
    }
}
